package models

var MakeTaskStatistics = new(TaskStatistics)

type TaskStatistics struct {
	Id             int     `json:"-" gorm:"primary_key" json:"id"`
	Operate        string  `json:"operate" gorm:"column:operate;type:varchar(255);size:255;comment:任务标识"`
	SuccessCount   int     `json:"success_count" gorm:"column:success_count;type:int(11);comment:任务成功执行次数"`
	Region         string  `json:"region" gorm:"column:region;type:int(11);comment:任务执行的国家"`
	FailedCount    int     `json:"failed_count" gorm:"column:failed_count;type:int(11);comment:任务失败执行次数"`
	FiveOnly       int     `json:"five_only" gorm:"column:five_only;type:int(11);comment:5分钟去重ip 数量"`
	TenOnly        int     `json:"ten_only" gorm:"column:ten_only;type:int(11);comment:10分钟去重ip 数量"`
	TwentyOnly     int     `json:"twenty_only" gorm:"column:twenty_only;type:int(11);comment:20分钟去重ip 数量"`
	ThirtyOnly     int     `json:"thirty_only" gorm:"column:thirty_only;type:int(11);comment:30分钟去重ip 数量"`
	SixtyOnly      int     `json:"sixty_only" gorm:"column:sixty_only;type:int(11);comment:60分钟去重ip 数量"`
	SixHourOnly    int     `json:"six_hour_only" gorm:"column:six_hour_only;type:int(11);comment:6小时去重ip 数量"`
	DayOnly        int     `json:"day_only" gorm:"column:day_only;type:int(11);comment:1天去重ip 数量"`
	CountrySuccess int     `json:"country_success" gorm:"column:country_success;type:int(11);comment:国家成功数量（random除外）"`
	CountryFailed  int     `json:"country_failed" gorm:"column:country_failed;type:int(11);comment:国家失败执行次数（random除外）"`
	DelayAvg       float64 `json:"delay_avg" gorm:"column:delay_avg;type:float;comment:平均延时"`
	CreatedAt      int64   `json:"-" gorm:"column:created_at;type:int(20);comment:创建时间"`
}

type StatisticsParam struct {
	Operate   string `json:"operate" form:"operate" binding:"required"`
	StartTime int64  `json:"start_time" `
	EndTime   int64  `json:"end_time"`
}

func (t *TaskStatistics) TableName() string {
	return "wt_task_statistics"
}
